feat: promote memory to cache-memory tool and add first-class azure-devops tool#167
Conversation
…irst-class tools Rename the existing tools directory to safeoutputs to better reflect its purpose (safe-output MCP tool implementations that serialize to NDJSON in Stage 1 and execute in Stage 2). Create a new src/tools directory for first-class tool implementations that the compiler auto-configures (cache-memory, azure-devops). Move memory.rs from safeoutputs to tools/cache_memory.rs since memory is a first-class tool, not a safe-output. Add CacheMemoryToolConfig and AzureDevOpsToolConfig types to compile/types.rs with support for both boolean and object front-matter formats. Extend ToolsConfig to include cache-memory and azure-devops fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move memory configuration from safe-outputs: memory: to tools: cache-memory: in the front matter. This aligns with gh-aw's cache-memory tool pattern where memory is a first-class tool, not a safe-output. Key changes: - Update has_memory detection in standalone.rs and onees.rs to read from tools.cache-memory instead of safe-outputs.memory - Update main.rs Stage 2 executor to resolve MemoryConfig from tools.cache-memory - Remove 'memory' from NON_MCP_SAFE_OUTPUT_KEYS and ALL_KNOWN_SAFE_OUTPUTS - Update integration tests to use tools: cache-memory: format - Update enabled-tools-args tests (memory no longer affects filtering) - No backward compatibility for safe-outputs.memory Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add tools.azure-devops as a first-class compiler tool that auto-configures
the Azure DevOps MCP container in the MCPG config. This replaces the need
for manual mcp-servers configuration with boilerplate container/entrypoint
settings.
When tools.azure-devops is enabled, the compiler:
- Auto-generates a containerized stdio MCP entry (node:20-slim + npx
@azure-devops/mcp) in the MCPG configuration
- Auto-maps ADO token (AZURE_DEVOPS_EXT_PAT) passthrough when
permissions.read is configured
- Adds ADO-specific hosts to the network allowlist
- Supports toolsets (repos, wit, core etc.) as -d flags
- Supports explicit tool allow-list for MCPG filtering
- Auto-infers org from pipeline runtime variables with optional override
- Warns on conflict with manual mcp-servers.azure-devops entry
Front-matter example:
tools:
azure-devops:
toolsets: [repos, wit]
allowed: [wit_get_work_item]
org: myorg # optional, auto-inferred
Also adds ADO_ORG_NAME runtime extraction to the base template for
org auto-inference from $(System.TeamFoundationCollectionUri).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update architecture tree to show src/safeoutputs/ and src/tools/ - Add cache-memory and azure-devops tool documentation under Tools Configuration - Update memory safe-output section to point to new tools.cache-memory location - Update front-matter example to show new tool entries - Update 'Adding New Features' section with safeoutputs vs tools distinction - Update azure-devops-mcp.md example to use tools.azure-devops instead of manual mcp-servers configuration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Solid structural refactor with one functional bug and two minor issues worth addressing before merge. Findings🐛 Bugs / Logic Issues
🔒 Security Concerns
|
Replace the runtime $(ADO_ORG_NAME) pipeline variable approach with compile-time inference using the existing parse_ado_remote() function. The compiler now extracts the org from the git remote URL when compiling. Key changes: - generate_mcpg_config() now returns Result and accepts inferred_org - Compilation fails with a clear error if tools.azure-devops is enabled but no org can be determined (no explicit override + no ADO git remote) - Remove $(ADO_ORG_NAME) runtime substitution from base.yml template - Remove unused project field from AzureDevOpsOptions (not supported by @azure-devops/mcp and was silently discarded) - Make get_git_remote_url public for use by the compiler - Add test_ado_tool_no_org_fails and test_ado_tool_explicit_org_overrides_inferred Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The ADO MCP only accepts org as a positional arg. The project field was added speculatively but is not a supported option. Keep only org (with compile-time git remote inference and explicit override). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace hardcoded ghcr.io/github/gh-aw-mcpg in base.yml with
{{ mcpg_image }} marker, replaced by MCPG_IMAGE constant in
standalone.rs — single source of truth for the image name
- Fix stale comment in mcp.rs that still referenced 'memory' in
NON_MCP_SAFE_OUTPUT_KEYS (now empty)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good overall — clean, well-structured refactor with solid test coverage. Two suggestions worth addressing before merge. Findings
|
- Validate org name (alphanumerics + hyphens only) at compile time to catch invalid values early instead of cryptic MCPG runtime failures - Validate toolset names with the same rule - Add specific deprecation hint when safe-outputs: memory: is detected, directing users to tools: cache-memory: - Add tests for invalid org and invalid toolset rejection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Solid refactor — well-structured, correct security controls, clean module separation. One missing compile-time guard and a PR description inaccuracy worth noting. Findings
|
Summary
This PR refactors the
tools:front-matter section to support first-class tool integrations alongside the existingbash/editcontrols. Two changes:1. Memory → cache-memory tool
safe-outputs: memory:totools: cache-memory:cache-memorytool patternclearMemoryparameter auto-injection now keyed offtools.cache-memorysafe-outputs.memory2. First-class Azure DevOps MCP
tools: azure-devops:auto-configures the ADO MCP container (node:20-slim+npx @azure-devops/mcp)toolsets(ADO API groups likerepos,wit,core) andallowed(explicit tool filter)$(System.TeamFoundationCollectionUri)at runtime, overridable viaorg:fieldmcp-servers:boilerplate for ADO integration3. Directory restructure
src/tools/→src/safeoutputs/(safe-output MCP tool implementations)src/tools/for first-class tool implementationsmemory.rs→tools/cache_memory.rsTarget front-matter shape
safe-outputs:continues to hold write-requiring tools (create-work-item, create-pr, etc.) unchanged.Test Results
All 736 tests pass. 8 new tests for ADO MCP tool configuration, 9 new tests for type deserialization.